﻿using System.Xml.Linq;
using Microsoft.Data.Entity.Design.Extensibility;
using System.ComponentModel;

namespace Liekhus.EntityFramework.XAFExtensions.CustomAttributes
{
    /// <summary>
    /// 
    /// </summary>
    public class DevExpressVersionProperty : BaseCustomAttribute<string>
    {
        #region Constructor
        /// <summary>
        /// Default Constructor to register the custom EDMX Extension
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="context"></param>
        public DevExpressVersionProperty(XElement parent, PropertyExtensionContext context) : base(parent, context)
        {

        }
        #endregion

        #region Properties
        /// <summary>
        /// The name of the Property to be displayed in the EDMX designer for this data
        /// </summary>
        public override string PropertyName { get { return "DevXVersion"; } }
        /// <summary>
        /// The string Format (if any) to use when creating the source code for this property in the Concrete class
        /// </summary>
        public override string PropertyFormat { get { return string.Empty; } }
        /// <summary>
        /// The Default value that should be loaded for this property
        /// </summary>
        public override string DefaultValue { get { return "11.2"; } }
        /// <summary>
        /// The actual "Value" for this custom property that should be used when creating the source code.
        /// </summary>
        [DisplayName("DevX Version")]
        [Description("The DevX assembly/DLL version <Major>.<Minor> to use when adding References to the target project.")]
        public override string PropertyValue
        {
            get
            {
                return base.PropertyValue;
            }
            set
            {
                base.PropertyValue = value;
            }
        }
        #endregion
    }
}
